package com.jdbc.dao;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class AccountDaoImpl implements AccountDao{
	@Resource
	public JdbcTemplate jt;
	@Override
	public void accountOut(String accountOut, int money) {
		String sql = "update account set account_money=account_money-? where account_name=?";
		jt.update(sql,money,accountOut);
	}

	@Override
	public void accountIn(String accountIn, int money) {
		String sql = "update account set account_money=account_money+? where account_name=?";
		jt.update(sql,money,accountIn);
	}

}
